<%-- internal/maintain/patron/index.jsp --%>

<?xml version="1.0" encoding="UTF-8"?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="problemDomain.EmployeeAccountBean, problemDomain.EmployeeAccountBean.Position" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<%

//get the currently logged on employee from session
EmployeeAccountBean employee = (EmployeeAccountBean)session.getAttribute("employee");
EmployeeAccountBean.Position pos = null;
if (employee != null)
	pos = employee.getPosition();
else {
	response.sendRedirect("../../login/");
	return;
}

if (pos != Position.MANAGER) {
	response.sendRedirect("../../login/");
	return;
}

%>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<link type="text/css" rel="stylesheet" href="../../css/general.css" />
		<link type="text/css" rel="stylesheet" href="../../css/framed.css" />
		<script type="text/javascript" src="../../js/ajax-handler.js"></script>
		<script type="text/javascript" src="../../js/form.js"></script>
		<script type="text/javascript" src="../../js/dialog.js"></script>
		<script type="text/javascript" src="../../js/patron/maintain.js"></script>
		<script type="text/javascript" src="../../js/patron/form.js"></script>
		<title>ORDRS - Maintain Patron Account</title>
	</head>
	<body ><!-- onload="loadPage()"> -->
		<!-- Title -->
		<div class="pageTitle">
			<img src="../../images/logo.bmp" />
			<!-- Logout -->
			<div class="navi">
				<table class="navi" align="right">
					<tr>
					<%
					out.println("<td class=\"navi\"><a href=\"../delivery/\">Delivery</a></td>");
					out.println("<td class=\"navi\"><a href=\"../food-item/\">Food Item</a></td>");
					out.println("<td class=\"navi\"><a href=\"../employee/\">Employee</a></td>");
					out.println("<td class=\"navi\"><a href=\"../menu-item/\">Menu Item</a></td>");
					out.println("<td class=\"navi\"><a href=\"../menu/\">Order</a></td>");
					out.println("<td class=\"navi\"><a href=\"../../view/report/\">Report</a></td>");
					out.println("<td class=\"navi\"><a href=\"../reservation/\">Reservation</a></td>");
					%>
						
						<td class="navi"><a href="../../login/">Logout</a></td>
					</tr>
				</table>
			</div>
			<!-- END Logout -->
		</div>
		<!-- END Title -->
		
		<!-- Panel -->
		<div class="panel">
		<fieldset>
		<legend>Maintain Patron</legend>
			<table style="border: 0px; width: 100%;">
				<tr style="height: 100%">
					<td rowspan="2">
						<!-- Fields -->
						<div class="fields">
						<form name="patronForm">
						<input id="id" type="hidden" />
							<table>
								
								<tr>
									<td>First Name:</td>
									<td><input id="firstname" type="text" /></td>
									<td id="firstnameMessage"></td>
								</tr>
								<tr>
									<td>Last Name:</td>
									<td><input id="lastname" type="text" /></td>
									<td id="lastnameMessage"></td>
								</tr>
								<tr>
									<td>Phone:</td>
									<td><input id="phone" type="text" /></td>
									<td id="phoneMessage"></td>
								</tr>
								<tr>
									<td>Username:</td>
									<td><input id="username" type="text" /></td>
									<td id="usernameMessage"></td>
								</tr>
								<tr>
									<td>Password:</td>
									<td><input id="password" type="password" /></td>
									<td id="passwordMessage"></td>
								</tr>
								<tr>
									<td>Email:</td>
									<td><input id="email" type="text" /></td>
									<td id="emailMessage"></td>
								</tr>
								<tr>
									<td>Street:</td>
									<td><input id="street" type="text" /></td>
									<td id="streetMessage"></td>
								</tr>
								<tr>
									<td>City:</td>
									<td><input id="city" type="text" /></td>
									<td id="cityMessage"></td>
								</tr>
								<tr>
									<td>Province:</td>
									<td><input id="province" type="text" size="2" maxlength="2"/></td>
									<td id="provinceMessage"></td>
								</tr>
								<tr>
									<td>Postal Code:</td>
									<td><input id="postalcode" type="text" size="6" maxlength="6"/></td>
									<td id="postalcodeMessage"></td>
								</tr>
							</table>
						</form>
						</div>
						<!-- END Fields -->
					</td>
					<td rowspan="2" class="vrule"></td>
					<td class="resultsHead">Results</td>
				</tr>
				<tr>
					<td class="resultsTD">
						<!-- Results -->
						<div id="results" class="results">
						</div>
						<!-- END Results -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- Toolbar -->
						<ul class="toolbar">
							<li onclick="createAccount()">Create</li>
							<li onclick="reportAccount()">Search</li>
							<li onclick="updateAccount()">Update</li>
							<li onclick="deleteAccount()">Delete</li>
							<li onclick="resetFields()">Clear</li>
						</ul>
						<!-- END Toolbar -->
					</td>
					<td></td>
					<td class="rightAligned">
						<!-- List All Button -->
						<ul class="toolbar">
							<li onclick="listAll()">List All</li>
						</ul>
					</td>
				</tr>
			</table>
		</fieldset>
		</div>
		<!-- END Panel -->
	</body>
</html>
